/**
  ETFRoot project, Anyang Normal University && IMP-CAS
  \class ETFMixedOfflineSource
  \brief to process Mixed offline data. Now to specialise for the case at ETF,
  we are not making the class general as its name may signify, but to designate
  the mixed source to be the combination of a VME data file and a PXI data file.
  It may incoporate more files in future. But each file would be make unique by
  equipping member variables to each of them.
  \author SUN Yazhou, asia.rabbit@163.com
  \since 2021-09-28
  \date 2021-09-28 last modified
  \attention
  changelog
  <table>
  <tr>  <th>Date        <th>Author      <th>Description                    </tr>
  <tr>  <td>2021-09-28   <td>Asia Sun    <td>file created                   </tr>
  </table>

  \copyright Copyright (c) 2021 Anyang Normal U. && IMP-CAS with LGPLv3 LICENSE
*/

#ifndef ETFMixedOfflineSource_h
#define ETFMixedOfflineSource_h

#include "ETFOfflineSource.h"

class ETFPXIUnpacker;
class ETFVMEUnpacker;

class ETFMixedOfflineSource : public ETFOfflineSource{
public:
  ETFMixedOfflineSource(const string &pxifile = "", const string &vmefile = "");
  virtual ~ETFMixedOfflineSource();

  /// get one event from offline data file to memory
  virtual bool Init(); ///< open the file
  void SetPXIDataFile(const string &file);
  void SetVMEDataFile(const string &file);
  const char *GetPXIFileName() const{ return fPXIFileName; }
  const char *GetVMEFileName() const{ return fVMEFileName; }
  virtual void PrintSummary();
  virtual const TString ROOTFileName() const; ///< generate a file name for the output root
  virtual void FinishEvent(); // do something (e.g. print sth.) upon finishing an event

  ClassDef(ETFMixedOfflineSource, 0); ///< to process mixed offline data

protected:
  TString fPXIFileName;
  TString fVMEFileName;
  ETFPXIUnpacker *fPXIUnpacker; //!
  ETFVMEUnpacker *fVMEUnpacker; //!
};

#endif
